<template>
  <!-- 编辑器预览组件 -->
  <div>
    <el-dialog :visible.sync="dialogVisible" :show-close="false" width="800px" @close="close">
      <div class="header">
        <div><span class="line"></span>{{ form.title }}</div>
        <i class="el-icon-close" @click="close"></i>
      </div>
      <!-- <div class="material-tag">
        <span class="tag" v-for="(item, index) in detail.labels">{{ item }}</span>
      </div> -->
      <!-- <div class="material-time">
        上传时间：2024年10月11日
      </div> -->
      <el-row :gutter="10" class="mb8">
        <div class="material-desc" v-html="form.content"></div>
      </el-row>
      <!-- <div class="btn">
        <el-row :gutter="40" class="mb8">
          <el-col :span="1.5">
            <el-button plain @click="result">编辑</el-button>
          </el-col>
        </el-row>
      </div> -->
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "Preview",
  data() {
    return {
      title: "",
      dialogVisible: false,
      // 表单参数
      form:{},
      dp:null,
      options: {},
    };
  },
  mounted() {},
  methods: {
    close() {
      this.dialogVisible = false;
    },
    result(){
      const player = this.$refs.dplayer.dp
      console.log(player)
      
      // player.re
    },
    show(form) {
      this.form = form;
      this.dialogVisible = true;
    },
    handleEdit(){

    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["model"].validate((valid, model) => {
        // if (valid) {
        // }
        console.log(valid, model);
      });
    },
  },
};
</script>
<style scoped lang="scss">
.btn {
  width: 100%;
  padding: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.material-video{
  img{
    width: 100%;
  }
}
.material-desc{
  // max-height: 500px;
  // overflow-y: scroll;
  line-height: 22px;
  font-size: 14px;
  
}
.header{
  display: flex;
  justify-content: space-between;
  padding: 20px 0 0;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid #D4DEEA;
  padding-bottom: 10px;
  margin-bottom: 10px;
  .line{
    display: inline-block;
    width: 2px;
    height: 13px;
    background-color: #2552E4;
    margin-right: 5px;
  }
  i{
    font-size: 26px;
    cursor: pointer;
    margin-left: 60px;
  }
}
.material-time{
  margin-bottom: 10px;
  border-bottom: 1px solid #D4DEEA;
  padding-bottom: 10px;
  font-size: 12px;
}
.material-tag{
      margin: 10px 0 10px;
      .tag{
        display: inline-block;
        background: rgba(9, 184, 68, 0.08);
        color: #09B844;
        padding: 3px 10px;
        font-size: 12px;
        border-radius: 2px;
        margin-right: 10px;
      }
      .tag:last-child{
        background: rgba(0, 87, 255, 0.08);
        color: #0057FF;
      }
    }
::v-deep{
  .el-dialog__header{
    padding: 0;
  }
  .material-desc p{
    margin: 0;
  }
  .material-desc img{
    width: 100%;
  }
}
</style>
